import request from "@/config/utils/request";
import { loadingParams, pageLoadingParams } from "@/basa/utils/public";

// 列表查询
export function getList(data) {
  return request({
    url: "/apis/smp/smppcconc/listSmpContractCreationPage",
    method: "POST",
    data: { ...data, ...pageLoadingParams }
  });
}

// 协议框架的列表
export function listProtocolinfoPage(data) {
  return request({
    url: "/apis/smp/frameworkPlan/qrySupplyProtocolInfo",
    method: "POST",
    data
  });
}

// 采购计划的列表
export function listPurplanPage(data) {
  return request({
    url: "/apis/smp/frameworkPlan/listMatPurplanDetlPage",
    method: "POST",
    data
  });
}

// 采购方案的列表
export function listPursckinfoPage(data) {
  return request({
    url: "/apis/smp/frameworkPlan/listMatPursckinfoPage",
    method: "POST",
    data
  });
}

// 根据合同id查询物资合同详情
export function getSmpPcConc(data) {
  return request({
    url: "/apis/smp/smppcconc/getSmpPcConcById",
    method: "POST",
    data: { ...data, ...loadingParams }
  });
}

// 新增--起草合同
export function saveSmpContractCreation(data, config = {}) {
  return request({
    url: "/apis/smp/smppcconc/saveSmpContractCreation",
    method: "POST",
    data: { ...data, ...loadingParams },
    ...config
  });
}

// 编辑--起草合同
export function editSmpContractCreation(data, config = {}) {
  return request({
    url: "/apis/smp/smppcconc/editSmpContractCreation",
    method: "POST",
    data: { ...data, ...loadingParams },
    ...config
  });
}

// 撤回--起草合同
export function revokeSmpContractCreation(data) {
  return request({
    url: "/apis/smp/smppcconc/revokeSmpContractCreation",
    method: "POST",
    data: { ...data, ...loadingParams, loadingMessage: "撤回中,请稍等..." }
  });
}

// 删除--起草合同
export function removeSmpContractCreation(data) {
  return request({
    url: "/apis/smp/smppcconc/removeSmpContractCreation",
    method: "POST",
    data: { ...data, ...loadingParams, loadingMessage: "删除中,请稍等..." }
  });
}

// 填报单位
export function listUserPartJobComInfo(data) {
  return request({
    url: "/apis/smp/basic/listUserPartJobComInfo",
    method: "POST",
    data
  });
}

// 搜索组织机构树
export function searchList(data) {
  return request({
    url: "/apis/smp/basic/getOrgAgreeTreeSearch",
    method: "post",
    data
  });
}
// 组织机构树
export function qryOmcOrgTree(data) {
  return request({
    url: "/apis/smp/basic/getOrgAgreeTree",
    method: "post",
    data
  });
}

// 基本信息 - 合同乙方
export function listConSupPage(data) {
  return request({
    url: "/apis/smp/basic/listConSupPage",
    method: "POST",
    data
  });
}
